package com.xlb.web.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * @author 小聋包
 * @date 2024/5/13
 * @Version 1.0
 */
@Data
@ApiModel(value = "用户实体类")
public class User {
    //用户名
    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名")
    private String username;
    //性别
    @NotNull(message = "性别不能为空")
    @ApiModelProperty(value = "性别")
    private Integer sex;

    //年龄
    @NotNull(message = "年龄不能为空")
    @Min(value = 18,message = "年龄不能小于18岁")
    @Max(value = 100,message = "年龄不能大于100岁")
    @ApiModelProperty(value = "年龄")
    private Integer age;

    //邮箱
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    @ApiModelProperty(value = "邮箱")
    private String email;

    //创建时间
    private LocalDateTime createTime;
    //更新时间
    private LocalDate updateDate;
    //时间
    private LocalTime time;

}
